/*
package com.awonsome.auth.controller;

import cn.hutool.json.JSONUtil;
import com.awonsome.common.core.result.Result;
import com.awonsome.common.web.util.RequestUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.security.oauth2.provider.endpoint.TokenEndpoint;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

//import java.security.KeyPair;
import java.security.Principal;
import java.util.Map;

*/
/**
 * 认证中心
 *
 * @author yangdejun
 * @date 2022/1/24 22:30
 *//*

@RestController
@RequestMapping(value = "/oauth")
//@AllArgsConstructor
@Slf4j
public class AuthController {

    @Autowired
    private TokenEndpoint tokenEndpoint;
    //private KeyPair keyPair;

    */
/**
     * OAuth2 认证，登录入口
     *
     * @param principal
     * @param parameters
     * @return
     *//*

    @PostMapping(value = "/token")
    public Object postAccessToken(Principal principal, @RequestParam Map<String, String> parameters) throws HttpRequestMethodNotSupportedException {
        String clientId = RequestUtils.getOAuth2ClientId();
        log.info("OAuth 认证授权，客户端 ID: {}，请求参数: {}", clientId, JSONUtil.toJsonStr(parameters));
        OAuth2AccessToken accessToken = tokenEndpoint.postAccessToken(principal, parameters).getBody();
        return Result.success(null);
    }
}
*/
